package com.ms.service.module.analysisgroup.async;

import com.ms.service.module.analysisgroup.db.AnalysisGroupDAO;
import com.ms.service.module.analysisgroup.db.model.CoinExpenditureLogModel;
import com.ms.service.module.analysisgroup.db.model.GameRevenueAndExpenditureAlertLogModel;
import com.ms.service.module.analysisgroup.db.model.GameRevenueAndExpenditureModel;
import com.xpec.c4.service.module.task.TaskAsyncCommand;

public class SaveGameRevenueAndExpenditureLogAsync extends TaskAsyncCommand{

	/**遊戲收支紀錄*/
	private GameRevenueAndExpenditureModel model;
	
	/**C幣支出紀錄*/
	private CoinExpenditureLogModel coinModel;
	
	/**警示紀錄*/
	private GameRevenueAndExpenditureAlertLogModel alertModel;
	
	@Override
	public void asyncExecute() throws Exception {
		if(model != null)
			AnalysisGroupDAO.getInstance().saveGameRevenueAndExpenditureLog(model);
		if(coinModel != null)
			AnalysisGroupDAO.getInstance().saveCoinExpenditureLog(coinModel);
		if(alertModel != null)
			AnalysisGroupDAO.getInstance().saveGameRevenueAndExpenditureAlertLog(alertModel);
	}

	@Override
	public void execute() throws Exception {
		
	}

	public GameRevenueAndExpenditureModel getModel() {
		return model;
	}

	public void setModel(GameRevenueAndExpenditureModel model) {
		this.model = model;
	}

	public CoinExpenditureLogModel getCoinModel() {
		return coinModel;
	}

	public void setCoinModel(CoinExpenditureLogModel coinModel) {
		this.coinModel = coinModel;
	}

	public GameRevenueAndExpenditureAlertLogModel getAlertModel() {
		return alertModel;
	}

	public void setAlertModel(GameRevenueAndExpenditureAlertLogModel alertModel) {
		this.alertModel = alertModel;
	}
	
}
